//
//  MyAnnotationFactory.swift
//  Runner
//
//  Created by James Karl on 2020/5/13.
//  Copyright © 2020 The Chromium Authors. All rights reserved.
//

import Foundation
import amap
import MAMapKit

class MyAnnotationFactory : MapAnnotationFactory {
    func create(_ mapView: MAMapView, _ registrar: FlutterPluginRegistrar, _ options: AnnotationViewData) -> MAAnnotationView? {
        var annotationView: MyAnnotationView? = mapView.dequeueReusableAnnotationView(withIdentifier: "myAnnotationView") as? MyAnnotationView
        if annotationView == nil {
            annotationView = MyAnnotationView.init(
                frame: CGRect(x: 0, y: 0, width: 60, height: 60),
                mapView: mapView, options: options, registrar: registrar)
        }
        return annotationView
    }
}
